"""
https://www.w3cschool.cn/pygame/pygame-bodt3mhu.html
"""
import pygame
#引入pygame中所有常量，比如 QUIT
from pygame.locals import *


pygame.init()
screen = pygame.display.set_mode((500,250))
pygame.display.set_caption('transform-demo')

#加载一张图片（455*191)
img_path='static/images/狗子1.jpg'
image_surface = pygame.image.load(img_path).convert()
image_new = pygame.transform.scale(image_surface,(300,300))

# 查看新生成的图片的对象类型
#print(type(image_new))
# 对新生成的图像进行旋转至45度
image_1 =pygame.transform.rotate(image_new,135)
# 使用rotozoom() 旋转 0 度，将图像缩小0.5倍
image_2 = pygame.transform.rotozoom(image_1,0,0.8)


while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            exit()
    # 将最后生成的image_2添加到显示屏幕上
    screen.blit(image_2,(0,0))
    pygame.display.update()